import request from "@/utils/request";

// 查询设备列表列表
export function listEquipment(query) {
  return request({
    url: "/machine/equipment/list",
    method: "get",
    params: query,
  });
}

// 查询设备列表详细
export function getEquipment(equipmentID) {
  return request({
    url: "/machine/equipment/" + equipmentID,
    method: "get",
  });
}

// 新增设备列表
export function addEquipment(data) {
  return request({
    url: "/machine/equipment",
    method: "post",
    data: data,
  });
}

// 修改设备列表
export function updateEquipment(data) {
  return request({
    url: "/machine/equipment",
    method: "put",
    data: data,
  });
}

// 删除设备列表
export function delEquipment(equipmentID) {
  return request({
    url: "/machine/equipment/" + equipmentID,
    method: "delete",
  });
}
//查询所有门店名称和ID
export function getAllStoreNameID() {
  return request({
    url: "/store/manage/getStoreIdAndName",
    method: "get",
  });
}
// 获取未绑定的机台
export function getNoUseList() {
  return request({
    url: "/machine/manage/getNoUseList",
    method: "get",
  });
}
// 获取未绑定的机台
export function getAllUseList() {
  return request({
    url: "/machine/manage/getAllUseList",
    method: "get",
  });
}

// 绑定和解绑 板子
export function edit(query) {
  return request({
    url: "/machine/manage",
    method: "PUT",
    data: query,
  });
}
// 绑定 板子
export function bindEquipment(query) {
  return request({
    url: "/machine/equipment/bindEquipment",
    method: "PUT",
    data: query,
  });
}
//  解绑 板子
export function unbindEquipment(query) {
  return request({
    url: "/machine/equipment/unbindEquipment",
    method: "PUT",
    data: query,
  });
}
